package com.model.pool;

import com.face.ConstantDecorate;
import com.model.ClassInfo;
import com.model.structure.ConstantPool;
import com.util.Analysis;
import com.util.SystemNumber;
import lombok.Data;

/**
 * @author seven
 */
@Data
public class ConstantDoubleInfo extends BaseConstantDecorate implements ConstantDecorate {
    private Double bytes;
    private Integer bytesLen=8;
    /**
     * 解析double常量
     * @param info
     */
    @Override public void invoke(ClassInfo info, Analysis analysis,int tag) {
        if(tag == SystemNumber.SIX){
            this.setBytes(analysis.util.sixteenToDouble(analysis.readValue(this.getBytesLen())));
            this.setConstantPoolInfoType("CONSTANT_Double_info");
            this.setTag(tag);
            info.getPoolList().add(this);
        }else{
            new ConstantFieldInfo().invoke(info,analysis,tag);
        }
    }
}
